package com.kingdee.eas.fi.gl.app;

import javax.ejb.*;
import java.rmi.RemoteException;
import com.kingdee.bos.*;
import com.kingdee.bos.util.BOSObjectType;
import com.kingdee.bos.metadata.IMetaDataPK;
import com.kingdee.bos.metadata.rule.RuleExecutor;
import com.kingdee.bos.metadata.MetaDataPK;
//import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.framework.ejb.AbstractEntityControllerBean;
import com.kingdee.bos.framework.ejb.AbstractBizControllerBean;
//import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.IObjectCollection;
import com.kingdee.bos.service.ServiceContext;
import com.kingdee.bos.service.IServiceContext;
import com.kingdee.eas.framework.Result;
import com.kingdee.eas.framework.LineResult;
import com.kingdee.eas.framework.exception.EASMultiException;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;

import java.lang.String;
import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.eas.common.EASBizException;
import java.util.Map;
import com.kingdee.eas.framework.CoreBaseCollection;
import com.kingdee.eas.framework.app.ObjectBaseControllerBean;
import com.kingdee.bos.dao.IObjectCollection;
import com.kingdee.eas.framework.CoreBaseInfo;
import com.kingdee.eas.framework.ObjectBaseCollection;
import com.kingdee.eas.fi.gl.CashflowRecordCollection;
import java.util.List;
import com.kingdee.eas.fi.gl.CashflowRecordInfo;
import com.kingdee.eas.fi.gl.CashFlowFilterPara;



public abstract class AbstractCashflowRecordControllerBean extends ObjectBaseControllerBean implements CashflowRecordController
{
    protected AbstractCashflowRecordControllerBean()
    {
    }

    protected BOSObjectType getBOSType()
    {
        return new BOSObjectType("CDE1C722");
    }

    public CashflowRecordCollection getCashflowRecordCollection(Context ctx) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("d46d5155-00f9-1000-e000-002bc0a8106f"), new Object[]{ctx});
            invokeServiceBefore(svcCtx);
            CashflowRecordCollection retValue = (CashflowRecordCollection)_getCollection(ctx, svcCtx);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectCollection _getCollection(Context ctx, IServiceContext svcCtx) throws BOSException
    {
        return super._getCollection(ctx, svcCtx);
    }

    public CashflowRecordCollection getCashflowRecordCollection(Context ctx, EntityViewInfo view) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("d46d5155-00f9-1000-e000-002cc0a8106f"), new Object[]{ctx, view});
            invokeServiceBefore(svcCtx);
            CashflowRecordCollection retValue = (CashflowRecordCollection)_getCollection(ctx, svcCtx, view);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectCollection _getCollection(Context ctx, IServiceContext svcCtx, EntityViewInfo view) throws BOSException
    {
        return super._getCollection(ctx, svcCtx, view);
    }

    public Object[] genCashFlow(Context ctx, CashFlowFilterPara cashFlowFilterPara) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("94ca1948-00fb-1000-e000-0009c0a81278"), new Object[]{ctx, cashFlowFilterPara});
            invokeServiceBefore(svcCtx);
            Object[] retValue = (Object[])_genCashFlow(ctx, cashFlowFilterPara);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract Object[] _genCashFlow(Context ctx, CashFlowFilterPara cashFlowFilterPara) throws BOSException, EASBizException;

    public CashflowRecordCollection getCashflowRecordCollection(Context ctx, String oql) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("9632ec84-00fb-1000-e000-0002c0a81278"), new Object[]{ctx, oql});
            invokeServiceBefore(svcCtx);
            CashflowRecordCollection retValue = (CashflowRecordCollection)_getCollection(ctx, svcCtx, oql);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectCollection _getCollection(Context ctx, IServiceContext svcCtx, String oql) throws BOSException
    {
        return super._getCollection(ctx, svcCtx, oql);
    }

    public void saveCashflowCols(Context ctx, IObjectCollection cashflowCols, Map mapParam) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("ac6f37c3-0104-1000-e000-001ac0a8127a"), new Object[]{ctx, cashflowCols, mapParam});
            invokeServiceBefore(svcCtx);
            _saveCashflowCols(ctx, cashflowCols, mapParam);
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _saveCashflowCols(Context ctx, IObjectCollection cashflowCols, Map mapParam) throws BOSException, EASBizException;

    public Map getDifference(Context ctx) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("bee561c4-010d-1000-e000-0025c0a812d1"), new Object[]{ctx});
            invokeServiceBefore(svcCtx);
            Map retValue = (Map)_getDifference(ctx);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract Map _getDifference(Context ctx) throws BOSException, EASBizException;

    public Map getColAndDifference(Context ctx, String vchId) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("bee561c4-010d-1000-e000-0027c0a812d1"), new Object[]{ctx, vchId});
            invokeServiceBefore(svcCtx);
            Map retValue = (Map)_getColAndDifference(ctx, vchId);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract Map _getColAndDifference(Context ctx, String vchId) throws BOSException, EASBizException;

    public boolean hasExchangeItem(Context ctx) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("cba54dbe-010f-1000-e000-002cc0a81364"), new Object[]{ctx});
            invokeServiceBefore(svcCtx);
            boolean retValue = (boolean)_hasExchangeItem(ctx);
            svcCtx.setMethodReturnValue(new Boolean(retValue));
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract boolean _hasExchangeItem(Context ctx) throws BOSException;

    public CashflowRecordCollection lazyLoad(Context ctx, Map saveParam) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("531832fb-0113-1000-e000-0028c0a8122f"), new Object[]{ctx, saveParam});
            invokeServiceBefore(svcCtx);
            CashflowRecordCollection retValue = (CashflowRecordCollection)_lazyLoad(ctx, saveParam);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract IObjectCollection _lazyLoad(Context ctx, Map saveParam) throws BOSException, EASBizException;

    public Map saveUn(Context ctx, CashflowRecordCollection cfCol) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("566cdfe8-0113-1000-e000-0025c0a8122f"), new Object[]{ctx, cfCol});
            invokeServiceBefore(svcCtx);
            Map retValue = (Map)_saveUn(ctx, cfCol);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract Map _saveUn(Context ctx, IObjectCollection cfCol) throws BOSException, EASBizException;

    public boolean clear(Context ctx, String voucherId) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("66e366de-0114-1000-e000-002bc0a8122b"), new Object[]{ctx, voucherId});
            invokeServiceBefore(svcCtx);
            boolean retValue = (boolean)_clear(ctx, voucherId);
            svcCtx.setMethodReturnValue(new Boolean(retValue));
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract boolean _clear(Context ctx, String voucherId) throws BOSException, EASBizException;

    public void addNewBatch(Context ctx, CashflowRecordCollection records) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("0e3d6a62-a72e-4b12-a0b5-ec5d17cf2983"), new Object[]{ctx, records});
            invokeServiceBefore(svcCtx);
            _addNewBatch(ctx, records);
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _addNewBatch(Context ctx, IObjectCollection records) throws BOSException, EASBizException;

    public void deleteBatch(Context ctx, List pks) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("f0772e6c-6a70-4994-9293-e097245ccc25"), new Object[]{ctx, pks});
            invokeServiceBefore(svcCtx);
            _deleteBatch(ctx, pks);
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _deleteBatch(Context ctx, List pks) throws BOSException, EASBizException;

    public void releaseTempTable(Context ctx, String tableName) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("1a9d9150-6b21-4cbf-8777-ebbf792bfbc0"), new Object[]{ctx, tableName});
            invokeServiceBefore(svcCtx);
            _releaseTempTable(ctx, tableName);
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _releaseTempTable(Context ctx, String tableName) throws BOSException;

    public Map queryAssignedIncorrectVoucher(Context ctx, boolean queryPrimaryItem, boolean querySupplementaryItem, Map params) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("b4f5821a-1f3e-4fc8-841c-01967df44504"), new Object[]{ctx, new Boolean(queryPrimaryItem), new Boolean(querySupplementaryItem), params});
            invokeServiceBefore(svcCtx);
            Map retValue = (Map)_queryAssignedIncorrectVoucher(ctx, queryPrimaryItem, querySupplementaryItem, params);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract Map _queryAssignedIncorrectVoucher(Context ctx, boolean queryPrimaryItem, boolean querySupplementaryItem, Map params) throws BOSException, EASBizException;

    public ObjectBaseCollection getObjectBaseCollection (Context ctx) throws BOSException
    {
    	return (ObjectBaseCollection)(getCashflowRecordCollection(ctx).cast(ObjectBaseCollection.class));
    }
    public ObjectBaseCollection getObjectBaseCollection (Context ctx, EntityViewInfo view) throws BOSException
    {
    	return (ObjectBaseCollection)(getCashflowRecordCollection(ctx, view).cast(ObjectBaseCollection.class));
    }
    public ObjectBaseCollection getObjectBaseCollection (Context ctx, String oql) throws BOSException
    {
    	return (ObjectBaseCollection)(getCashflowRecordCollection(ctx, oql).cast(ObjectBaseCollection.class));
    }
    public CoreBaseCollection getCoreBaseCollection (Context ctx) throws BOSException
    {
    	return (CoreBaseCollection)(getCashflowRecordCollection(ctx).cast(CoreBaseCollection.class));
    }
    public CoreBaseCollection getCoreBaseCollection (Context ctx, EntityViewInfo view) throws BOSException
    {
    	return (CoreBaseCollection)(getCashflowRecordCollection(ctx, view).cast(CoreBaseCollection.class));
    }
    public CoreBaseCollection getCoreBaseCollection (Context ctx, String oql) throws BOSException
    {
    	return (CoreBaseCollection)(getCashflowRecordCollection(ctx, oql).cast(CoreBaseCollection.class));
    }
}